<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>自定义添加Marker</title>
    <link href='bundle.css' rel='stylesheet'/>
    <!-- 引入js文件 -->
    <script src="../static/js/bundle.js"></script>
    <script src="../static/js/config.js"></script>
</head>
<body>
<div id="map" style='width: 1440px; height: 1280px;'></div>
<script type="application/javascript">
    var vectorMap = new creeper.VectorMap('map', config.wmapId, config.mapBaseUrl);

    var marker = undefined;

    vectorMap.on('click', function (e) {
        if (marker !== undefined) {
            marker.remove();
        }
        marker = new creeper.Marker()
            .setLngLat(e.lngLat)
            .addTo(vectorMap);
    });
</script>
</body>
</html>